package main



/*
嵌入类型

*/


import (
	"log"
)


type notifier3 interface {
	notify()
}

type user3 struct {
	name string
	email string
}

type admin3 struct {
	user3
	level string
}


func (this *user3) notify()  {
	log.Printf("send user notify %s send email(%s)\n", this.name, this.email)
}


func (this admin3) notify()  {
	log.Printf("send admin notify %s send email(%s)\n", this.name, this.email)
}


func sendNotification3(n notifier3)  {
	n.notify()
}

func changeUserName(admin3 *admin3)  {
	admin3.user3.name = "newuserName"
}


func main() {

	ad := admin3 {
		user3:user3{"zhu", "sfsf@qq.ccd"},
		level:"gaoji",
	}

	log.Println(ad)
	changeUserName(&ad)
	log.Println(ad)

	ad.user3.notify()
	ad.notify()




}
